import {Base} from "../../../utils/base.js";

class ExamCategory extends Base{
  constructor(){
    super()
  }

  /**
   * 获取顶级分类
   * @param {*} success 
   * @param {*} fail 
   */
  getTopList(success,fail){
    this.request({
        url: '/get_exam_top_category',
        success: function (res) {
            success && success(res.data)
        },
        fail:function(res){
            fail && fail(res)
        }
    })
  }

  /**
   * 获取所有子分类
   * @param {*} id 
   * @param {*} success 
   * @param {*} fail 
   */
  getChildList(id,success,fail){
      this.request({
          url:'/get_exam_category/'+id,
          success:function(res){
              success&&success(res.data)
          },
          fail:function(res){
              fail&&fail(res.data)
          }
      })
  }
}

export {ExamCategory}